package com.quasar.hpatient.presenter;

import com.quasar.hpatient.model.custommodel.TestTable;
import com.quasar.hpatient.model.requestmodel.RequestModel;
import com.quasar.hpatient.onInterface.AnotherResultListener;
import com.quasar.hpatient.onInterface.viewInterface.UiInterface;

import java.util.List;

/**
 * author : 许建宏
 * Date: 2017/10/24 0024
 * View:获取单日化验记录
 */

public class TestTablePresenter  {

    private RequestModel requestModel;
    private UiInterface<List<TestTable>> uiInterface;

    public TestTablePresenter(UiInterface<List<TestTable>> uiInterface) {
        this.requestModel = new RequestModel();
        this.uiInterface = uiInterface;
    }

    public void PostAddFriend(){
//
//        final List<TestTable> testList=new ArrayList<>();
//
//        requestModel.TestRecordDataModel(recordTime, new AnotherResultListener<AnotherResult<TestRecordData>>() {
//            @Override
//            public void onSuccess(AnotherResult<TestRecordData> data) {
//
//                int size=data.getList().size();
//                for(int i=0;i<size;i++){
//                    testList.add(new TestTable(true,data.getList().get(i).getTestId()+"", true));
//                    testList.add(new TestTable(new TestTableItem("肌酐", 44, "umol/L", 45)));
//                }
//
//
//              //  uiInterface.onViewSuccess();
//            }
//
//            @Override
//            public void onError(String msg) {
//
//            }
//
//            @Override
//            public void onRefreshUI() {
//
//            }
//        });

        requestModel.HistoryLaboratory(new AnotherResultListener<List<TestTable>>() {
            @Override
            public void onSuccess(List<TestTable> data) {
                uiInterface.onViewSuccess(data);
            }

            @Override
            public void onError(String msg) {

            }

            @Override
            public void onRefreshUI() {

            }
        });


    }
}
